package com.bm.server.controller;

import com.bm.common.bo.ChatBo;
import com.bm.common.util.Rutils;
import com.bm.common.vo.R;
import com.bm.server.serves.WebSocketMore;
import org.springframework.web.bind.annotation.*;

/**
 * @Description:
 * @Author: 赵金帅
 * @Date: 2022/07/21/11:17
 */
@RestController
@RequestMapping("/server/send/")
public class SendMsgController {
    /**单发消息*/
    @PostMapping("onemsg.do")
    public R sendOne(@RequestBody  ChatBo bo){
        WebSocketMore.sendSingleMsg(bo.getUid(), bo.getMsg());
        return Rutils.ok();
    }
    @PostMapping("moremsg.do")
    public R sendmore(@RequestParam String msg){
        WebSocketMore.sendMoreMsg(msg);
        return Rutils.ok();
    }
}
